package org.truenewx.tnxjee.service.spec.fsm;

import org.truenewx.tnxjee.model.spec.user.UserIdentity;

/**
 * 状态转换时的上下文
 *
 * @param <S> 状态枚举类型
 * @param <I> 用户标识类型
 */
public class StateTransitContext<S extends Enum<S>, I extends UserIdentity<?>> {

    private S beginState;
    private I userIdentity;
    private Object payload;

    public StateTransitContext(S beginState, I userIdentity, Object payload) {
        this.beginState = beginState;
        this.userIdentity = userIdentity;
        this.payload = payload;
    }

    public S getBeginState() {
        return this.beginState;
    }

    public I getUserIdentity() {
        return this.userIdentity;
    }

    public Object getPayload() {
        return this.payload;
    }

}
